<?php
include "vhod.php";
	
	 if($_POST["confirm"])
	{
	 $a=new PROV();
	 $b=$a->full() ;
	 $val=array_values($b);
		  if(!empty($b))
		{			
		 $db = new DB();
		 $find=count($db->find('user','id','login',$val[0]));
		 if ($find==0)
		 	{
		 		
		 		$db->insert('user',$b);
		 		header("Location: autoriz.php"); exit(); 
		 	}
		 	else echo("Такой логин уже существует");
		 }		
	}
?>
<html>
<HEAD>
<META http-equiv=content-type content="text/html; charset=utf-8">
</HEAD>
<body >
<br><br><br><br><br>
<form action="reg.php" method="post" name="frt" >
<table align="center">
<tr><td >Логин </td>
<td> <input type="text" size="30" maxlength="15" name="login" id="login" value="<?php echo $_POST["login"] ?>"></td></tr>
<tr><td >Фамилия </td>
<td> <input type="text" size="15" maxlength="15" name="familia" id="familia" value="<?php echo $_POST["familia"] ?>"></td></tr>
<tr><td>Имя </td>
<td> <input type="text" size="15" maxlength="15" name="name" id="name" value="<?php echo $_POST["name"]?>"></td></tr>
<tr><td>email</td>
<td><input type="text" size="30" maxlength="15" name="email" id="email" value="<?php echo $_POST["email"]?>"></td></tr>
<tr><td>Пароль</td>
<td><input type="text" size="15" maxlength="15" name="pass" id="pass" type="password" value="<?php echo $_POST["pass"]?>"></td></tr>
<tr><td colspan="2"><input type="hidden" name="confirm" id="confirm" value="12345"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" name="vvod" value="ввести "/></td></tr>
</table>
</form>
</body>
</html>


